﻿	CREATE TABLE public.period
	(
	    /***************************************************************************************************
	    **  Table:	    public.period
	    **  Author:		Zhixian Ong
	    **
	    **  Description:
	    **    
	    **    Represents a registered period.
	    **
	    **  Fields (5):
	    **
	    **      id              - 
	    **      full_name       -
	    **      display_name    -
	    **      date_start      -
	    **      date_end      -
	    **
	    **  Constaints (3):
	    **
	    **      period_pk           - 
	    **      period_full_name_uc -
	    **      period_date_uc      -
	    **
	    **  Modification History:
	    **
	    **      20140102  Zhixian Ong     - Initial prototype
	    ** 
	    **  Status:
	    **      Dev
	    ** 
	    ***************************************************************************************************/
        
	    -- [Fields]
	    id              character varying(36)   NOT NULL DEFAULT nextval('period_id_seq'),
	    full_name       character varying(128)  NOT NULL, 
	    display_name    character varying(128)  NOT NULL,
	    date_start      date                    NOT NULL,
	    date_end        date                    NOT NULL,
        
	    -- [Constraints]
	    CONSTRAINT period_pk            PRIMARY KEY ("id"),
	    CONSTRAINT period_full_name_uc  UNIQUE ("full_name"),
	    CONSTRAINT period_date_uc       UNIQUE ("date_start","date_end")
	);
